package com.atguigu.process.service;

import com.atguigu.model.process.Process;
import com.atguigu.vo.process.ApprovalVo;
import com.atguigu.vo.process.ProcessFormVo;
import com.atguigu.vo.process.ProcessQueryVo;
import com.atguigu.vo.process.ProcessVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * <p>
 * 审批类型 服务类
 * </p>
 *
 * @author atguigu
 * @since 2023-04-22
 */
public interface OaProcessService extends IService<Process> {

    /**
     * 分页查询
     *
     * @param pageParam      {@link IPage<ProcessVo>}
     * @param processQueryVo {@link ProcessQueryVo}
     * @return {@link IPage<ProcessVo>}
     */
    IPage<ProcessVo> selectPage(IPage<ProcessVo> pageParam, ProcessQueryVo processQueryVo);

    /**
     * 部署流程定义
     *
     * @param deployPath {@link String}
     */
    void deployByZip(String deployPath);

    /**
     * 启动流程实例
     *
     * @param processFormVo {@link ProcessFormVo}
     */
    void startUp(ProcessFormVo processFormVo);

    /**
     * 查询代办任务列表
     *
     * @param pageParam {@link IPage<Process>}
     * @return {@link IPage<Process>}
     */
    IPage<ProcessVo> findPending(IPage<Process> pageParam);

    /**
     * 查看审批详情信息
     *
     * @param id {@link Long}
     * @return {@link Map<String, Object>}
     */
    Map<String, Object> show(Long id);

    /**
     * 审批
     *
     * @param approvalVo {@link ApprovalVo}
     */
    void approve(ApprovalVo approvalVo);

    /**
     * 已处理
     *
     * @param pageParam {@link IPage<Process>}
     * @return {@link IPage<ProcessVo>}
     */
    IPage<ProcessVo> findProcessed(IPage<Process> pageParam);

    /**
     * 查询发起的审批
     *
     * @param pageParam {@link IPage<Process>}
     * @return {@link IPage<ProcessVo>}
     */
    IPage<ProcessVo> findStarted(Page<ProcessVo> pageParam);
}
